package com.ioftv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ioftv.entity.ProjectManager;
import com.ioftv.mapper.ProjectManagerMapper;
import com.ioftv.service.ProjectManagerService;
import com.ioftv.service.base.BaseService;
import org.springframework.stereotype.Service;

/**
 * 项目经理信息Service实现
 */
@Service
public class ProjectManagerServiceImpl extends BaseService<ProjectManagerMapper, ProjectManager> implements ProjectManagerService {

    @Override
    protected void addUserCondition(LambdaQueryWrapper<ProjectManager> queryWrapper) {
        queryWrapper.eq(ProjectManager::getUserId, getCurrentUserId());
    }

    @Override
    protected void setEntityUserId(ProjectManager entity) {
        if (entity.getUserId() == null) {
            entity.setUserId(getCurrentUserId());
        }
    }
}